import { defineConfig, presetIcons, presetWind, transformerDirectives, transformerVariantGroup } from 'unocss';
import presetRemToPx from '@unocss/preset-rem-to-px';

export default defineConfig({
	presets: [
		presetWind(),
		// 图标库
		presetIcons(),
		// unocss 默认 rem，转成 px
		presetRemToPx({
			baseFontSize: 4 // 1rem = 4px
		})
	],
	shortcuts: [
		/* ========== 常用组合 ========== */
		{ 'flex-col': 'flex flex-col' },
		{ 'flex-center': 'flex items-center justify-center' },
		{ 'flex-x-center': 'flex justify-center' },
		{ 'flex-y-center': 'flex items-center' },
		{ 'flex-col-center': 'flex-col items-center justify-center' },
		{ 'flex-between': 'flex justify-between items-center' },
		{ 'flex-stretch': 'flex items-stretch justify-stretch' },
		{ 'wh-full': 'w-full h-full' },
		{ pointer: 'cursor-pointer' }
	],
	transformers: [transformerDirectives(), transformerVariantGroup()]
});
